<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="full">搜查发电机</div>
    <button id="btn">全屏</button>

    <script src="https://cdn.jsdelivr.net/npm/medash@3.1.4/dist/medash.min.js"></script>
    <script>
        const { fullScreen } = medash; //导入fullScreen对象
        const btn = document.getElementById('btn')
        btn.onclick = () => {
            fullScreen.addEventListener(() => {
                console.log('成功');
            }, () => {
                console.log('失败');
            })
            console.log(fullScreen);
            fullScreen.isFullScreen() ? fullScreen.exitFullscreen() : fullScreen.requestFullscreen(btn);
            console.log(fullScreen.getFullscreenElement());
        }

    </script>
</body>

</html>